package hellfire.system.graphics;

public class GLBoundingBox 
{
	private GLVec2 pos, dim;
	
	
	public GLBoundingBox(float x, float y, float width, float height)
	{
		this.pos = new GLVec2(x,y);
		this.dim = new GLVec2(width, height);
	}
	
	public GLBoundingBox(GLVec2 pos, GLVec2 dim)
	{
		this.pos = pos;
		this.dim = dim;
	}

	public GLVec2 pos()
	{
		return pos;
	}
	
	
	
	public GLVec2 dim()
	{
		return dim;
	}
	
	/**
	 * Legacy/Compatibility method for creating a bounding box using corner + dims
	 * @param topLeft top left corner position
	 * @param dim dimensions where '1' is equal to half screen
	 * @return
	 */
	static GLBoundingBox fromCorner(GLVec2 topLeft, GLVec2 dim)
	{
		return new GLBoundingBox(topLeft.add(new GLVec2(dim.x(), -dim.y())), dim.mul(0.5f));
	}
	
}
